package com.jintu.portal.pojo.submit;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jintu.portal.pojo.RetEntity;
import lombok.Data;

/**
 * @author very
 */
@Data
public class OrderStatsResponse {

    private String orderId;
    private Integer orderStats;
    // 0 未获取数据 1 已经获取数据
    private JSONObject dataSourceStats;
    private String retCode;
    private String retMessage;
    private String usedRuleChainCode;
    private JSONArray usedScoreCards;
    private JSONObject riskRet;
    private String reportUrl;

    private OrderStatsResponse() {
    }

    public static OrderStatsResponse build(RetEntity retEntity) {
        OrderStatsResponse response = new OrderStatsResponse();
        response.setRetCode(retEntity.getCode());
        response.setRetMessage(retEntity.getMessage());
        response.setOrderId(ResponseCommonData.ORDER_ID_AND_EXT_DATA.get().get(ResponseCommonData.ORDER_ID));
        return response;
    }
}
